<template>
  <div>
    <Banner :sightName="sightName"
            :bannerImg="bannerImg"
            :gallaryImgs="gallaryImgs"/>
    <Header/>
    <div class="content">
      <List :list="list"/>
    </div>
  </div>
</template>

<script>
  import axios from 'axios'

  import Banner from './components/Banner'
  import Header from './components/Header'
  import List from './components/List'
  export default {
    name: 'Detail',
    components: {
      Banner,
      Header,
      List
    },
    data(){
      return{
        list: [],
        sightName: '',
        gallaryImgs: [],
        categoryList: [],
        bannerImg: ''
      }
    },
    methods:{
      getDetailInfo(){
        axios.get('/api/detail.json',{params:{id: this.$route.params.id}}).then(res => {
          const data = res.data;
          console.log(data)
          if(data.ret && data.data){
            this.sightName = data.data.sightName;
            this.gallaryImgs = data.data.gallaryImgs;
            this.list = data.data.categoryList;
            this.bannerImg = data.data.bannerImg;
          }
        })
      }
    },
    mounted(){
      this.getDetailInfo();
    },

  }
</script>

<style scoped lang="stylus">
 .content{
   height 50rem
 }
</style>
